//package com.mercury.ec.module.air.controller.admin.order;
//
//import com.mercury.ec.module.air.controller.admin.order.vo.orderpnrlog.AirOrderPnrLogPageReqVO;
//import com.mercury.ec.module.air.controller.admin.order.vo.orderpnrlog.AirOrderPnrLogRespVO;
//import com.mercury.ec.module.air.controller.admin.order.vo.orderpnrlog.AirOrderPnrLogSaveReqVO;
//import org.springframework.web.bind.annotation.*;
//import javax.annotation.Resource;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.security.access.prepost.PreAuthorize;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import io.swagger.v3.oas.annotations.Parameter;
//import io.swagger.v3.oas.annotations.Operation;
//
//import javax.validation.*;
//import javax.servlet.http.*;
//import java.util.*;
//import java.io.IOException;
//
//import com.mercury.ec.framework.common.pojo.PageParam;
//import com.mercury.ec.framework.common.pojo.PageResult;
//import com.mercury.ec.framework.common.pojo.CommonResult;
//import com.mercury.ec.framework.common.util.object.BeanUtils;
//import static com.mercury.ec.framework.common.pojo.CommonResult.success;
//
//import com.mercury.ec.framework.excel.core.util.ExcelUtils;
//
//import com.mercury.ec.framework.apilog.core.annotation.ApiAccessLog;
//import static com.mercury.ec.framework.apilog.core.enums.OperateTypeEnum.*;
//
//import com.mercury.ec.module.air.dal.dataobject.order.AirOrderPnrLogDO;
//import com.mercury.ec.module.air.service.order.AirOrderPnrLogService;
//
//@Tag(name = "管理后台 - 机票订单PNR日志")
//@RestController
//@RequestMapping("/air/order-pnr-log")
//@Validated
//public class AirOrderPnrLogController {
//
//    @Resource
//    private AirOrderPnrLogService orderPnrLogService;
//
//    @PostMapping("/create")
//    @Operation(summary = "创建机票订单PNR日志")
//    @PreAuthorize("@ss.hasPermission('air:order-pnr-log:create')")
//    public CommonResult<Long> createOrderPnrLog(@Valid @RequestBody AirOrderPnrLogSaveReqVO createReqVO) {
//        return success(orderPnrLogService.createOrderPnrLog(createReqVO));
//    }
//
//    @PutMapping("/update")
//    @Operation(summary = "更新机票订单PNR日志")
//    @PreAuthorize("@ss.hasPermission('air:order-pnr-log:update')")
//    public CommonResult<Boolean> updateOrderPnrLog(@Valid @RequestBody AirOrderPnrLogSaveReqVO updateReqVO) {
//        orderPnrLogService.updateOrderPnrLog(updateReqVO);
//        return success(true);
//    }
//
//    @DeleteMapping("/delete")
//    @Operation(summary = "删除机票订单PNR日志")
//    @Parameter(name = "id", description = "编号", required = true)
//    @PreAuthorize("@ss.hasPermission('air:order-pnr-log:delete')")
//    public CommonResult<Boolean> deleteOrderPnrLog(@RequestParam("id") Long id) {
//        orderPnrLogService.deleteOrderPnrLog(id);
//        return success(true);
//    }
//
//    @GetMapping("/get")
//    @Operation(summary = "获得机票订单PNR日志")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    @PreAuthorize("@ss.hasPermission('air:order-pnr-log:query')")
//    public CommonResult<AirOrderPnrLogRespVO> getOrderPnrLog(@RequestParam("id") Long id) {
//        AirOrderPnrLogDO orderPnrLog = orderPnrLogService.getOrderPnrLog(id);
//        return success(BeanUtils.toBean(orderPnrLog, AirOrderPnrLogRespVO.class));
//    }
//
//    @GetMapping("/page")
//    @Operation(summary = "获得机票订单PNR日志分页")
//    @PreAuthorize("@ss.hasPermission('air:order-pnr-log:query')")
//    public CommonResult<PageResult<AirOrderPnrLogRespVO>> getOrderPnrLogPage(@Valid AirOrderPnrLogPageReqVO pageReqVO) {
//        PageResult<AirOrderPnrLogDO> pageResult = orderPnrLogService.getOrderPnrLogPage(pageReqVO);
//        return success(BeanUtils.toBean(pageResult, AirOrderPnrLogRespVO.class));
//    }
//
//    @GetMapping("/export-excel")
//    @Operation(summary = "导出机票订单PNR日志 Excel")
//    @PreAuthorize("@ss.hasPermission('air:order-pnr-log:export')")
//    @ApiAccessLog(operateType = EXPORT)
//    public void exportOrderPnrLogExcel(@Valid AirOrderPnrLogPageReqVO pageReqVO,
//              HttpServletResponse response) throws IOException {
//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
//        List<AirOrderPnrLogDO> list = orderPnrLogService.getOrderPnrLogPage(pageReqVO).getList();
//        // 导出 Excel
//        ExcelUtils.write(response, "机票订单PNR日志.xls", "数据", AirOrderPnrLogRespVO.class,
//                        BeanUtils.toBean(list, AirOrderPnrLogRespVO.class));
//    }
//
//}
